Next is Cloud Run. Cloud Run is a fully managed compute
platform that enables you to run requests or event-driven stateless workloads
without having to worry about servers. It abstracts away all infrastructure
management such as provisioning, configuring, and managing servers,
so you can focus on writing code. It automatically scales up
and down from zero, almost instantaneously,
depending on traffic, so you never have to worry
about scale configuration. Cloud Run also charges you
only for the resources you use, rounded up to the nearest 100 milliseconds, so
you never pay for overprovisioned resources. Many serverless platforms
add constraints around support for languages and libraries,
or even restrict the way you code. Cloud Run enables
you to write code your way by letting you easily deploy
any stateless containers that listen for requests or events
delivered over HTTP. Containers offer flexibility
and portability of workloads. With Cloud Run, you can build
your applications in any language, using whatever frameworks and tools
you want, and deploy them in seconds. You can use a single command
to deploy containerized applications. After that, Cloud Run horizontally scales
your container image automatically in order to handle received requests, then scales it down when demand decreases. You only pay for the CPU, memory, and networking that are consumed
during request handling. The Cloud Run developer workflow
is a straightforward three-step process. First, use your favorite programming
language to write your application. This application should listen
for web requests. Second, build and package
your application into a container image. Finally, deploy the
container image to Cloud Run. When you deploy your container image,
you get a unique HTTP(S) URL. Cloud Run starts your container on demand to handle requests and dynamically adds
and removes containers to ensure capacity
to handle all incoming requests. When you build a container image,
you have full control over how the software is built
and how every file is added. Sometimes you need this control. However, building an application
is difficult enough already, and sometimes you just want to turn source
code into an HTTPS endpoint. You want to make sure
your container image is secure, well configured,
and built in a consistent way. With Cloud Run, you can choose
either approach. You can use a container-based workflow
or a source-based workflow. When you use the source-based approach,
you deploy your source code instead of a container image. Cloud Run then builds
your source and packages the application into a secure container
image for you automatically. Cloud Run uses buildpacks to do this. Buildpacks transform
your application source code into container images
that can run on any cloud. Google Cloud buildpacks are also used
for the internal build system for Cloud Functions and App Engine. Cloud Run can be used for many use cases. Cloud Run is an excellent choice
for data processing applications. Because you pay for—usage
not provisioned resources— you only pay when data is being processed. Cloud Run can also host small or large web applications and web APIs; it scales up when necessary and scales down to zero
when it is not in use. Jobs that must be run in response
to Pub/Sub or Eventarc events are good candidates for Cloud Run.